package itheima.com.mycountdown;

import java.util.concurrent.CountDownLatch;

public class ChileThread1 extends Thread {
    private CountDownLatch countDownLatch;

    public ChileThread1(CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }


    @Override
    public void run() {
        for (int i = 1; i <= 10; i++) {
            System.out.println(getName() + "再吃" + i + "个饺子");
        }
        //每次吃完让计数器减一
        countDownLatch.countDown();
    }
}
